-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reworking locations #54
Conversation
scripts/time-filter-proto.js
Outdated
const location = __ENV.LOCATION || 'UK/London' | ||
const country = location.slice(0, 2).toLowerCase() | ||
const countryCoords = getProtoCountryCoordinates(location) | ||
|
||
const query = __ENV.QUERY || `api/v2/${countryCode(country)}/time-filter/fast/${transportation}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the location.slice
is used to get the iso2 country-code from the location, it's needed to construct the proto request url. I could make the user specify the iso2 code manually, but this might be simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tho it could break if the user decides to add a new location and doesn't follow the same naming pattern. I have a warning on this in readme
0ff80e0
to
ca5ebb5
Compare
https://simplemaps.com/data/world-cities data was taken from here (the The file by default is a csv, I turned it into json manually. I can turn it back to csv if that would be more convenient |
ca5ebb5
to
c6386ec
Compare
lgtm |
Also removed this
"us_hi": { "lat": 21.3098845, "lng": -157.8581401 }
location from proto locations, as it just points to the ocean. Let me know if this is actually a useful location.